import { getAction } from "@/command/netTool";
import { useDetail } from "@/hooks";

export const useRequest = () => {
  const getLevelData = (item: any) => {
    getAction(`/api/H5/util/getProductLevel?id=${item.value}`).then((e) => {
      if (item.selectedOptions[item.tabIndex]["children"]) {
        item.selectedOptions[item.tabIndex]["children"] = e.map((el: any) => ({
          ...el,
          text: el.label,
        })) as never;
      }
    });
  };
  return {
    getLevelData,
  };
};
